/*
package com.tony.business.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.core.MethodParameter;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.http.server.ServletServerHttpResponse;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;

import javax.servlet.http.HttpServletRequest;

*/
/**
 * @author tony
 * @date 2020/6/14 17:20
 *//*

@ControllerAdvice
@Slf4j
public class InterceptResponse<T> implements ResponseBodyAdvice<T> {


    @Override
    public boolean supports(MethodParameter methodParameter, Class<? extends HttpMessageConverter<?>> aClass) {
        return true;
    }

    @Override
    public T beforeBodyWrite(T t, MethodParameter methodParameter, MediaType mediaType, Class<? extends HttpMessageConverter<?>> aClass, ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse) {
        log.debug("进入beforeBodyWrite方法，获取@ResponseBody的返回值");
        ServletServerHttpRequest requestTmp = (ServletServerHttpRequest) serverHttpRequest;
        HttpServletRequest request = requestTmp.getServletRequest();
        request.setAttribute("responseBody", t);
        return t;
    }
}
*/
